<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of checkNumArgs</title>
  <meta name="keywords" content="checkNumArgs">
  <meta name="description" content="Helper utility for checking numeric vector arguments.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html matlab -->
<h1>checkNumArgs
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Helper utility for checking numeric vector arguments.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [ x, er ] = checkNumArgs( x, siz, intFlag, signFlag ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Helper utility for checking numeric vector arguments.

 Runs a number of tests on the numeric array x.  Tests to see if x has all
 integer values, all positive values, and so on, depending on the values
 for intFlag and signFlag. Also tests to see if the size of x matches siz
 (unless siz==[]).  If x is a scalar, x is converted to a array simply by
 creating a matrix of size siz with x in each entry.  This is why the
 function returns x.  siz=M is equivalent to siz=[M M]. If x does not
 satisfy some criteria, an error message is returned in er. If x satisfied
 all the criteria er=''.  Note that error('') has no effect, so can use:
  [ x, er ] = checkNumArgs( x, ... ); error(er);
 which will throw an error only if something was wrong with x.

 USAGE
  [ x, er ] = checkNumArgs( x, siz, intFlag, signFlag )

 INPUTS
  x           - numeric array
  siz         - []: does not test size of x
              - [if not []]: intended size for x
  intFlag     - -1: no need for integer x
                 0: error if non integer x
                 1: error if non odd integers
                 2: error if non even integers
  signFlag    - -2: entires of x must be strictly negative
                -1: entires of x must be negative
                 0: no contstraints on sign of entries in x
                 1: entires of x must be positive
                 2: entires of x must be strictly positive

 OUTPUTS
  x   - if x was a scalar it may have been replicated into a matrix
  er  - contains error msg if anything was wrong with x

 EXAMPLE
  a=1; [a, er]=checkNumArgs( a, [1 3], 2, 0 ); a, error(er)

 See also NARGCHK

 Piotr's Computer Vision Matlab Toolbox      Version 2.0
 Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
 Licensed under the Simplified BSD License [see external/bsd.txt]</pre></div>





<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
